#This file creates Figure 2 - Caterpillar Plot
rm(list = ls())

points <- read.csv("all_colonies_1d_ideal_points.csv")

par(mar = c(10, 4, 3, 1))
plot(1:nrow(points), points$d1, pch = 16, ylim = c(-.6, .4), ylab = "Characteristic Score", axes = F, 
     xlab = "", main = "One Dimensional Constitution Characteristic Scores")
segments(x0 = 1:nrow(points), y0 = points$lowerd1, x1 = 1:nrow(points), y1 = points$upperd1)
axis(1, at = 1:nrow(points), labels = points$name, cex.axis = .6, las = 2)
axis(2, at = round(seq(-.6, .3, .15), 2), las = 2, cex.axis = .8)




points2 <- read.csv("all_colonies_2d_ideal_points.csv")
points2 <- points2[order(points2$d2d2),]

par(mar = c(10, 4, 3, 1))
plot(1:nrow(points2), points2$d2d2, pch = 16, ylim = c(-.5, .5), ylab = "Similarity Score - 2nd Dimension", axes = F, xlab = "", main = "Two Dimensional Constitution Characteristic Scores")
segments(x0 = 1:nrow(points2), y0 = points2$lowerd2d2, x1 = 1:nrow(points2), y1 = points2$upperd2d2)
axis(1, at = 1:nrow(points2), labels = points2$name, cex.axis = .6, las = 2)
axis(2, at = seq(-.5, .5, .1), las = 2, cex.axis = .8)

